	$(function(){
        //按钮单击时执行
        $("#auto_message_edit_do").click(function(){
			toastr.options = {
			  "closeButton": true,
			  "debug": false,
			  "progressBar": true,
			  "positionClass": "toast-bottom-full-width",
			  "onclick": null,
			  "showDuration": "400",
			  "hideDuration": "1000",
			  "timeOut": "7000",
			  "extendedTimeOut": "1000",
			  "showEasing": "swing",
			  "hideEasing": "linear",
			  "showMethod": "fadeIn",
			  "hideMethod": "fadeOut"
			}
			//输入验证
			if($("#auto_message_id").val() == ""){  
                toastr.warning("规则ID不能为空！");  
                $("#auto_message_id").focus();  
                return false;  
            }
			if($("#auto_message_bot").val() == ""){  
                toastr.warning("所属机器人ID不能为空！");  
                $("#auto_message_bot").focus();  
                return false;  
            }
			if($("#auto_message_key").val() == ""){  
                toastr.warning("关键字不能为空！");  
                $("#auto_message_key").focus();  
                return false;  
            }  
           if($("#auto_message_body").val() == ""){  
                toastr.warning("回复内容不能为空！");  
                $("#auto_message_body").focus();  
                return false;  
            }  
			var auto_message_id = $('#auto_message_id').val();
			var auto_message_bot = $('#auto_message_bot').val();
			var auto_message_key = $('#auto_message_key').val();
			var auto_message_body = $('#auto_message_body').val();
            //Ajax调用处理
            var auto_message_edit_do = $.ajax({
               type: "POST",
               url: "plus.php?m=auto_message&c=auto_message_home&a=auto_message_edit_do",
               data: "auto_message_id="+auto_message_id+"&auto_message_bot="+auto_message_bot+"&auto_message_key="+auto_message_key+"&auto_message_body="+auto_message_body,
               async: false
            }).responseText;
			if (auto_message_edit_do == "1"){
				toastr.info("规则修改失败！");
			} else if (auto_message_edit_do == "2") {
				toastr.success("规则修改成功！");
			} else {
				toastr.error("请勿提交非法数据！");
			}
         });		 
    });